const seq = require('../db_connect'),
      { STRING, INT, DECIMAL, DOUBLE} = require('../../configs/db_type');

const RecomBook = seq.define('recom_book', {
   bid: {
       comment: 'book ID',
       type: STRING,
       allowNull: false,
       unique: true
   },
   href: {
       comment: 'book`s img link',
       type: STRING,
       allowNull: false
   },
   bookTitle: {
       comment: 'book name',
       type: STRING,
       allowNull: false
   },
   readCount: {
       comment: 'people`s read count',
       type: INT,
   },
   author: {
       comment: '作者',
       type: STRING,
       allowNull: false
   },
   price: {
        comment: 'book price',
        type: DOUBLE,
        allowNull: false
   },
   copyright: {
       comment: '版权',
       type: STRING,
       allowNull: false
   },
   description: {
        comment: 'book description',
        type: STRING,
        allowNull: false
   },
   imgKey: {
        comment: 'qiniu image name',//储存在七牛上面的那个图片的名字
        type: STRING,
        allowNull: false
   },
   status: {
        comment: 'book status',
        type: INT,
        defaultValue: 1,
        allowNull: false
   }
})

module.exports = RecomBook;